<?php

class Pacientes extends CI_Controller {
	
	public function __construct() {
		parent::__construct();
	}
	
	//Lista de todos pacientes
	public function index(){
		$this->load->model('Nutritionist','n');
		$this->n->logged();
	
		$data['title']			= 'Pacientes';
		$data['email_n'] = $this->session->userdata('email_n');
		
		$this->load->model('Patient','p');
		$data['all_p'] = $this->p->get_patient_all();

		$this->load->view('area_admin/pacientes_view', $data);
		
	}
	

	//Cadastro de paciente
	public function novo_paciente(){
		$this->load->model('Nutritionist','n');
		$this->n->logged();
		
		$data['title']			= 'Cadastro';
		$data['email_n'] = $this->session->userdata('email_n');

		$this->load->view('area_admin/paciente_novo_view', $data);
	}
	
	//Area de controle do Paciente
	public function paciente_home($id){
		$this->load->model('Nutritionist','n');
		$this->n->logged();

		$this->load->model('Patient','p');
		$patient		= $this->p->get_patient_by_id($id);
		$data['title']	= $patient['name'];
		$data['email_n']= $this->session->userdata('email_n');
		$data['patient']= $patient;

		$this->load->view('area_admin/paciente_home_view', $data);
	}
}

/* End of file alimentos.php */
/* Location: ./application/controllers/area_admin/pacientes.php */